//
//  TechniciansFromTableViewCell.m
//  XingMei
//
//  Created by 钱金军 on 2019/3/22.
//  Copyright © 2019年 钱金军. All rights reserved.
//

#import "TechniciansFromTableViewCell.h"
#import "FilesHeader.h"

@implementation TechniciansFromTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 15, 75, 75)];
        [imgView setImage:[UIImage imageNamed:@"home_img_4"]];
        [self addSubview:imgView];
        
        UILabel *nameLab = [[UILabel alloc] initWithFrame:CGRectMake(imgView.right+15, imgView.top, KScreenWidth-imgView.right-15, 13)];
        nameLab.text = @"发型师：托尼老师";
        nameLab.textColor = rgba(51, 51, 51, 1);
        nameLab.textAlignment = NSTextAlignmentLeft;
        nameLab.font = [UIFont fontWithName:ZhongDeng size:13];
        [self addSubview:nameLab];
        
        for (int i = 0; i < 5; i++) {
            UIImageView *starsImgView = [[UIImageView alloc] initWithFrame:CGRectMake(nameLab.left + i*9 + i*2, nameLab.bottom + 8, 9, 9)];
            [starsImgView setImage:[UIImage imageNamed:@"home_icon_15"]];
            [self addSubview:starsImgView];
            
            if (i == 4) {
                _scoreLab = [[UILabel alloc] initWithFrame:CGRectMake(starsImgView.right + 7, starsImgView.top, 25, 10)];
                _scoreLab.text = @"5.0分";
                _scoreLab.textColor = rgba(255, 181, 22, 1);
                _scoreLab.textAlignment = NSTextAlignmentCenter;
                _scoreLab.font = [UIFont fontWithName:ZhongDeng size:10];
                
                [self addSubview:_scoreLab];
            }
        }
        
        UILabel *goodAtLab = [[UILabel alloc] initWithFrame:CGRectMake(nameLab.left, _scoreLab.bottom + 8, nameLab.frame.size.width, 10)];
        goodAtLab.text = @"擅长技能：剪发、美发、美容";
        goodAtLab.textColor = rgba(153, 153, 153, 1);
        goodAtLab.textAlignment = NSTextAlignmentLeft;
        goodAtLab.font = [UIFont fontWithName:ZhongDeng size:10];
        [self addSubview:goodAtLab];
        
        UIView *firstView = [[UIView alloc] initWithFrame:CGRectMake(nameLab.left, goodAtLab.bottom + 7, 55, 16)];
        firstView.backgroundColor = rgba(255, 180, 36, 0.1);
        [self addSubview:firstView];
        
        UILabel *firstLab = [[UILabel alloc] initWithFrame:CGRectMake(2, 4, firstView.frame.size.width-4, 8)];
        firstLab.text = @"人气达人";
        firstLab.textColor = rgba(255, 180, 36, 1);
        firstLab.textAlignment = NSTextAlignmentCenter;
        firstLab.font = [UIFont fontWithName:ZhongDeng size:9];
        [firstView addSubview:firstLab];
        
        /** 距离 */
        UILabel *distanceLab = [[UILabel alloc] initWithFrame:CGRectMake(KScreenWidth-80, firstView.top+3, 65, 10)];
        distanceLab.text = @"距离您620m";
        distanceLab.textColor = rgba(153, 153, 153, 1);
        distanceLab.textAlignment = NSTextAlignmentCenter;
        distanceLab.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:10];
        [self addSubview:distanceLab];
    }
    
    return self;
}

@end
